<!---
To do:
Need to block workshops that don't belong to Regional Admins, Organizers and Site Contacts by filtering on organizationID
Add in PB details
--->

<cfparam name="Workshop_ID" type="integer" />
<cfparam name="returnView" type="string" default="workshops" />
<cfparam name="passback" type="string" default="" />

<cfscript>
	workshopGateway = new assets.calgrants.com.gateway.WorkshopGateway();
	workshop = workshopGateway.get(Workshop_ID = Workshop_ID, Organization_ID = IIf(Workshop_ID gt 0 AND request.authUser.organizationID gt 0, request.authUser.organizationID, ""));
</cfscript>

<cfif workshop.getWorkshop_ID() gt 0>

	<cfscript>
		base = new assets.calgrants.com.Base();
		passbackQueryString = base.passbackToQueryString(passback);
		organizationGateway = new assets.calgrants.com.gateway.OrganizationGateway();
		organization = organizationGateway.get(Organization_ID = workshop.getOrganization_ID());
		siteGateway = new assets.calgrants.com.gateway.SiteGateway();
		site = siteGateway.get(Site_ID = workshop.getSite_ID());
		userGateway = new assets.calgrants.com.gateway.UserGateway();
		organizer = userGateway.get(User_ID = workshop.getOrganizer_ID());
		manager = userGateway.get(User_ID = workshop.getManager_ID());
	</cfscript>
	
	<script type="text/javascript">
		$(function() {
			$("#workshopModal").modal();
			resizeModal("workshopModal");
			// mark
		})
	</script>
	
	<cfoutput>
	
		<div id="workshopModal" class="modal modal-fullscreen" data-backdrop="static">
			<div class="modal-header">
				<h3>Workshop</h3>
			</div>
			<div class="modal-body">
				<div class="container-fluid">
					<div class="row-fluid">
						<div class="span4">
							<cfif workshop.getWorkshop_ID() gt 0>
								<div class="text-control">
									<label>Workshop ID</label>
									#workshop.getWorkshop_ID()#
								</div>
							</cfif>
							<div class="text-control">
								<label>Status</label>
								<input type="hidden" name="Approved" value="#workshop.getApproved()#" />
								<cfif workshop.getApproved() eq 1>
									Approved
								<cfelse>
									Pending Approval
								</cfif>
							</div>
							<div class="text-control">
								<label>Organization</label>
								#organization.getOrganization()#
							</div>
							<div class="text-control">
								<label>Date/Time</label>
								#DateFormat(workshop.getWorkshop_Date(), 'm/d/yyyy')# #TimeFormat(workshop.getStart_Time(), 'h:mmtt')#-#TimeFormat(workshop.getEnd_Time(), 'h:mmtt')#
							</div>
							<div class="text-control">
								<label>Site</label>
								#site.getSite()#<br />
								#site.getAddress()#<br />
								#site.getCity()#, CA #site.getZip_Code()#<br />
							</div>
							<div class="text-control">
								<label>Organizer</label>
								#organizer.getFirst_Name()# #organizer.getLast_Name()#<br />
								<a href="mailto:#organizer.getEmail()#">#organizer.getEmail()#</a><br />
								#organizer.getPhone()#<cfif Len(Trim(organizer.getExtension())) gt 0> x #organizer.getExtension()#</cfif>
							</div>
							<div class="text-control">
								<label>Site Contact</label>
								#manager.getFirst_Name()# #manager.getLast_Name()#<br />
								<a href="mailto:#manager.getEmail()#">#manager.getEmail()#</a><br />
								#manager.getPhone()#<cfif Len(Trim(manager.getExtension())) gt 0> x #manager.getExtension()#</cfif>
							</div>
						</div>
						<div class="span4">
							<label>Basic Services</label>
							<cfset hasBasicService = false />
							<div class="well well-framed clearfix">
								<ul style="margin-bottom: 0px;">
									<cfif workshop.getOnline() eq 1>
										<li>Computer lab access to complete FAFSA</li>
										<cfset hasBasicService = true />
										<!--- <cfelse>
											<li>Computer lab access to complete FAFSA NOT offered for the following reasons:</li>
											<ul>
												<cfloop index="offlineReason" list="#workshop.getOffline_Reasons()#">
													<li>#offlineReason#</li>
												</cfloop>
											</ul> --->
									</cfif>
									<cfif workshop.getFAFSA_On_The_Web() eq 1>
										<li>FAFSA on the Web worksheet presentation</li>
										<cfset hasBasicService = true />
									</cfif>
									<cfif workshop.getFinancial_Aid_Presentation() eq 1>
										<li>Cal Grant &amp; other financial aid overview</li>
										<cfset hasBasicService = true />
									</cfif>
									<cfif workshop.getSmall_Group() eq 1>
										<li>One-on-one or small group assistance</li>
										<cfset hasBasicService = true />
									</cfif>
									<cfif workshop.getAB540() eq 1>
										<li>AB540/CA Dream Act assistance</li>
										<cfset hasBasicService = true />
									</cfif>
									<cfif NOT hasBasicService>
										<li>None</li>
									</cfif>
								</ul>
							</div>
							<label>Additional Services</label>
							<cfset hasAdditionalService = false />
							<div class="well well-framed clearfix">
								<ul style="margin-bottom: 0px;">
									<cfif workshop.getAlt_Language_Workshop() eq 1>
										<li>Alternate language workshop: #workshop.getAlt_Languages()#</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getTranslators() eq 1>
										<li>Traslators: #workshop.getTranslator_Languages()#</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getTax_Assistance() eq 1>
										<li>Income tax assistance</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getFoster_Youth() eq 1>
										<li>Foster youth assistance</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getRefreshments() eq 1>
										<li>Refreshements</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getChild_Care() eq 1>
										<li>Child care</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif workshop.getOther_Services() eq 1>
										<li>Other services: #workshop.getOther_Services_Description()#</li>
										<cfset hasAdditionalService = true />
									</cfif>
									<cfif NOT hasAdditionalService>
										<li>None</li>
									</cfif>
								</ul>
							</div>
						</div>
						<div class="span4">
							<div class="text-control">
								<label>Anticipated number of students</label>
								#workshop.getAnticipated_Students()#
							</div>
							<div class="text-control">
								<label>Anticipated number of volunteers</label>
								#workshop.getAnticipated_Volunteers()#
							</div>
							<div class="text-control">
								<label>Anticipated number of computers</label>
								#workshop.getAnticipated_Computers()#
							</div>
							<div class="text-control">
								<label>Wrapper Code</label>
								#workshop.getEvaluation_Code()#
							</div>
							<cfif IsUserInRole("Super User")>
								<label>Paper Based Surveys</label>
								<div class="well clearfix">
									<div class="clearfix">
										<label>Status</label>
										#workshop.getPB_Survey_Count_Status()#
									</div>
									<div class="clearfix">
										<label>Count</label>
										#workshop.getPB_Survey_Count()#
									</div>
									<div class="clearfix">
										<label>Notes</label>
										<cfif Len(Trim(workshop.getPB_Notes())) gt 0>
											#workshop.getPB_Notes()#
										<cfelse>
											None
										</cfif>
									</div>
								</div>
							</cfif>
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<a href="?view=#returnView#&#passbackQueryString#" class="btn btn-success">Close</a>
			</div>
		</div>
	
	</cfoutput>

<cfelse>

	<div class="alert alert-info notFound">Workshop not found</div>

</cfif>